//
//  MovieTableViewCell.m
//  UI_元旦豆瓣半完整版
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "MovieTableViewCell.h"

#define WIDCH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation MovieTableViewCell

- (void)dealloc {
    [_movieImage release];
    [_titleLable release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubviews];
    }
    return self;
}

- (void)creatSubviews {
    self.movieImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_movieImage];
    [_movieImage release];
    
    self.titleLable = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLable];
    [_titleLable release];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    UIImageView *blueImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg_eventlistcell@2x.png"]];
    blueImage.frame = CGRectMake(10, 25, WIDCH - 20, HEIGHT - 50);
    [self.contentView addSubview:blueImage];
    [blueImage release];
    
    _titleLable.frame = CGRectMake(140, HEIGHT / 2 - 50, 200, 50);
    _titleLable.font = [UIFont systemFontOfSize:20];
    _titleLable.backgroundColor = [UIColor clearColor];
    [blueImage addSubview:_titleLable];
    
    _movieImage.frame = CGRectMake(10, 10, 120, HEIGHT - 75);
    _movieImage.backgroundColor = [UIColor clearColor];
    [blueImage addSubview:_movieImage];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
